import book.Booklist;
import user.AdminUser;
import user.Normaluser;
import user.User;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Main {
    public static User login(){
        System.out.println("其输入你的名字：");
        Scanner scanner =new Scanner(System.in);
        String name =scanner.nextLine();
        while (true){
            System.out.println("请输入你的身份：1.管理员  2.用户");
            int choice =scanner.nextInt();
            if(choice==1){
                return new AdminUser();
            }else if (choice==2){
                return new Normaluser();
            }else {
                System.out.println("输入错误请重新输入");
            }
        }
    }
    public static void main(String[] args) {
        Booklist booklist=new Booklist();
        User user =login();
        while (true){
            int choice=user.meau();
            user.doOpearation(choice,booklist);
        }
    }
}
